package com.team7.stat.controller;

import com.team7.stat.entity.Course;
import com.team7.stat.service.CourseService;
import com.team7.stat.utils.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @ClassName: CourseController
 * @Description: 课程 前端控制器
 * @Author: 赵孟阳
 * @Date: 2021/10/19 21:25
 */
@RestController
@RequestMapping("/stat/course")

@Api(tags = "课程排行 ")
public class CourseController {
    @Resource
    private CourseService courseService;
    @PostMapping("/queryAllCourseRanking")
    @ApiOperation(value = "根据课程查询课程数量")
    public CommonResult queryAllCourseRanking(@RequestBody Course course){
        System.out.println("----------"+course);
        CommonResult commonResult = courseService.queryAllCourseRanking(course);
        System.out.println(commonResult);
        return new CommonResult(2000,"查询成功",commonResult);
    }
}
